﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="milanov.Edit" %>
<%-- Edit pagina door Wytse --%>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <hgroup class="title">
        <h1>Details berwerken<br />
        </h1>
    </hgroup>

    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="FileID" DataSourceID="SqlDataSourceFotos">
        <Columns>

            <asp:BoundField DataField="Filename" HeaderText="Filename" SortExpression="Filename" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment" />
            <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
            <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceFotos" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:fotosDB %>" DeleteCommand="DELETE FROM [Fotos] WHERE [FileID] = @original_FileID AND [Filename] = @original_Filename AND [Name] = @original_Name AND (([Comment] = @original_Comment) OR ([Comment] IS NULL AND @original_Comment IS NULL)) AND [Category] = @original_Category AND [Filesize] = @original_Filesize AND (([Width] = @original_Width) OR ([Width] IS NULL AND @original_Width IS NULL)) AND (([Height] = @original_Height) OR ([Height] IS NULL AND @original_Height IS NULL)) AND (([Uploadtime] = @original_Uploadtime) OR ([Uploadtime] IS NULL AND @original_Uploadtime IS NULL)) AND [Price] = @original_Price" InsertCommand="INSERT INTO [Fotos] ([Filename], [Name], [Comment], [Category], [Filesize], [Width], [Height], [Uploadtime], [Price]) VALUES (@Filename, @Name, @Comment, @Category, @Filesize, @Width, @Height, @Uploadtime, @Price)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Fotos]" UpdateCommand="UPDATE [Fotos] SET [Filename] = @Filename, [Name] = @Name, [Comment] = @Comment, [Category] = @Category, [Filesize] = @Filesize, [Width] = @Width, [Height] = @Height, [Uploadtime] = @Uploadtime, [Price] = @Price WHERE [FileID] = @original_FileID AND [Filename] = @original_Filename AND [Name] = @original_Name AND (([Comment] = @original_Comment) OR ([Comment] IS NULL AND @original_Comment IS NULL)) AND [Category] = @original_Category AND [Filesize] = @original_Filesize AND (([Width] = @original_Width) OR ([Width] IS NULL AND @original_Width IS NULL)) AND (([Height] = @original_Height) OR ([Height] IS NULL AND @original_Height IS NULL)) AND (([Uploadtime] = @original_Uploadtime) OR ([Uploadtime] IS NULL AND @original_Uploadtime IS NULL)) AND [Price] = @original_Price">
        <DeleteParameters>
            <asp:Parameter Name="original_FileID" Type="Int32" />
            <asp:Parameter Name="original_Filename" Type="String" />
            <asp:Parameter Name="original_Name" Type="String" />
            <asp:Parameter Name="original_Comment" Type="String" />
            <asp:Parameter Name="original_Category" Type="String" />
            <asp:Parameter Name="original_Price" Type="Decimal" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Filename" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Comment" Type="String" />
            <asp:Parameter Name="Category" Type="String" />
            <asp:Parameter Name="Price" Type="Decimal" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Filename" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Comment" Type="String" />
            <asp:Parameter Name="Category" Type="String" />
            <asp:Parameter Name="Price" Type="Decimal" />
            <asp:Parameter Name="original_FileID" Type="Int32" />
            <asp:Parameter Name="original_Filename" Type="String" />
            <asp:Parameter Name="original_Name" Type="String" />
            <asp:Parameter Name="original_Comment" Type="String" />
            <asp:Parameter Name="original_Category" Type="String" />
            <asp:Parameter Name="original_Price" Type="Decimal" />
        </UpdateParameters>
    </asp:SqlDataSource>

</asp:Content>


